<template>
  <div style="width:50%;text-align:center;margin:auto;">
    <el-form ref="dataForm" :rules="rules" :model="updateSysConfigtemp" label-position="left" label-width="90px" style="margin-left:50px;margin-right:50px;">
      <el-form-item label="数量" prop="value">
        <el-input-number v-model.trim="updateSysConfigtemp.value" @change="handleChange" :min="1" label="请输入配置内容" style="width: 100%;"></el-input-number>
      </el-form-item>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button @click="dialogFormVisible = $emit('dialogSysVisibleEmit', false)">
        取消
      </el-button>
      <el-button type="primary" :loading="loading" @click="createData()">
        确认
      </el-button>
    </div>
  </div>
</template>

<script>
export default {
  name: 'PassWordForm',
  props: {
    updateSysConfigtemp: { type: Object, default: Object }
  },
  data() {
    return {
      loading: false,
      rules: {}
    }
  },
  methods: {
    handleChange(value) {
        this.updateSysConfigtemp.value = value
      },
    createData() {
      const temp2 = {
        id: this.updateSysConfigtemp.id,
        value: this.updateSysConfigtemp.value
      }
      this.$refs['dataForm'].validate((valid) => {
        if (valid) {
          this.$emit('createPassword', temp2)
        }
      })
    }
  }
}
</script>
